using System.Threading;

namespace BLL.Model
{
    public class SingleInstance
    {
        public SingleInstance(string name)
        {
            Name = name;

            bool ownsMutex;
            SingleInstanceMutex = new Mutex(true, name, out ownsMutex);
            OwnsMutex = ownsMutex;
        }

        public Mutex SingleInstanceMutex { get; private set; }
        public string Name { get; private set; }
        public bool OwnsMutex { get; private set; }
    }
}